package com.stone.stone_mall.component;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * spring task 定时任务配置
 *
 * spring task 虽然简单 但是不能把任务信息存入数据库 不如 Quartz 实用。
 */
@Component
public class OrderTimeOutCancelTask {
    private Logger logger = (Logger) LoggerFactory.getLogger(OrderTimeOutCancelTask.class);

    @Scheduled(cron = "0 0/10 * ? * ?")
    private void  cancelTimeOutOrder(){
        //TODO：调用取消订单的操作
        logger.info("定时任务取消订单");
    }
}
